import SMERouter from 'sme-router'
import {home} from '../controllers/home'
import {position} from '../controllers/position'

const router = new SMERouter('content')

router.use((req) => { 
  let url=req.url.slice(1) 
  $(`#side-main-menu li[data-url=${url}] `).addClass('active').siblings().removeClass('active') 
  })

  window.route=router
  
router.route('/home', home)
router.route('/position', position)

router.route('*', (req, res, next) => {
    res.redirect('/home')
  })
 export  default router